package com.example.administrator.birdmall;


import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TabHost;
import android.widget.TextView;

import com.example.administrator.birdmall.fragment.HomeFragment;
import com.example.administrator.birdmall.widget.FragmentTabHost;

public class MainActivity extends FragmentActivity {
    private LayoutInflater layoutInflater;
    private FragmentTabHost mTabHost;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        layoutInflater = LayoutInflater.from(this);
        mTabHost = this.findViewById(android.R.id.tabhost);
        mTabHost.setup(this,getSupportFragmentManager(),R.id.realtabcontent);
        TabHost.TabSpec tabSpec = mTabHost.newTabSpec("home");
        View view = layoutInflater.inflate(R.layout.tab_indicator,null);
        ImageView imageView = findViewById(R.id.icon_tab);
        TextView textView = findViewById(R.id.text_indicator);

        imageView.setBackgroundResource(R.mipmap.icon_home);
        textView.setText("xx");

        tabSpec.setIndicator(view);
        mTabHost.addTab(tabSpec, HomeFragment.class,null);



    }
}
